/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package xmarti.vacaxm.beans.sequence;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 *
 * @author xmarti
 */
public class SequenceType {
    private int id;
    private String name;
    private String description;
    private Set<StateDefault> states=  new HashSet<StateDefault>();;

    public SequenceType() {
        this.id=-1;
        
    }

    public SequenceType(String name, String description) {
        
        this.name = name;
        this.description = description;
    }

    public SequenceType(String name, String description, Set<StateDefault> states) {
        
        this.name = name;
        this.description = description;
        this.states = states;
    }
    
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Set<StateDefault> getStates() {
        return states;
    }

    public void setStates(Set<StateDefault> states) {
        this.states = states;
    }
    public void changeOrder(StateDefault stateDefault1, int increment){
        int order1= stateDefault1.getOrder();
        int order2= order1+increment;
        for (StateDefault s: this.states){
            if (s.getOrder()==order1) s.setOrder(order2);
            else if (s.getOrder()==order2) s.setOrder(order1);
        }
    }
    @Override
    public String toString(){
        return this.name; 
    }
            
            
}
